import { createStore } from "vuex";
import playerState from "./player/state";
import { playerGetters } from "./player/getters";
import { playerMutations } from "./player/mutations";
import { playerActions } from "./player/actions";

import sysState from "./sys/state";
import { sysMutations } from "./sys/mutations";
import { sysActions } from "./sys/actions";

const store = createStore({
  state: {
    ...playerState,
    ...sysState,
    PlayerStateVersion: "1.0",
    SysStateVersion: "1.0"
  },
  mutations: {
    ...playerMutations,
    ...sysMutations
  },
  actions: {
    ...playerActions,
    ...sysActions
  },
  getters: {
    ...playerGetters
  }
  // plugins: [createLogger()]
});

export function useStore() {
  return store;
}

export default store;
